import { defineStore } from "pinia";
export type SystemInfo = {
  id: string;
  type: "Local" | "SSO";
  name: string;
  redirect?: string;
  icon?: string;
  modules?: string[];
}

interface ModulesViewState {
  curModuleName: string;
  curModule: SystemInfo | null;
}

export const useModulesViewStore = defineStore({
  id: 'modules-view',
  state: (): ModulesViewState => ({
    curModuleName: 'default',
    curModule:null
  }),
  getters:{},
  actions:{
    setCurModule(module:SystemInfo){
      this.curModule = module;
      this.curModuleName = module.name
    }
  },
})
